define(["jquery", "template", "bld/template/course/courseEdit.tpl"], function($, template, tpl) {
    var ui = {};

    var drawTableHead = function(data) {
        return template("courseEdit_tableHead", data);
    }
    var drawTableContent = function(data) {
        return template("courseEdit_tableContent", data);
    }
    var drawAdd = function(data) {
        return template("courseEdit_add", data);
    }
    var drawSmallClass = function(data) {
        return template("courseEdit_smallClass", data);
    }
    var drawSelectCallBack = function(data) {
        return template("courseEdit_select", data);
    }

    ui.tableHead = function(options) {
        options.dom.html(tpl.tableHead());
        var h = drawTableHead(options);
        options.dom.html(h);
    }
    ui.tableContent = function(options) {
        options.dom.html(tpl.tableContent());
        var h = drawTableContent(options);
        options.dom.html(h);
    }
    ui.add = function(options) {
        options.dom.html(tpl.add());
        var h = drawAdd(options);
        options.dom.html(h);
    }
    ui.smallClass = function(options) {
        options.dom.html(tpl.smallClass());
        var h = drawSmallClass(options);
        options.dom.html(h);
    }
    ui.selectCallBack = function(options) {
        $("#" + options.id).html(tpl.selectCallBack());
        var h = drawSelectCallBack(options);
        $("#" + options.id).html(h);
    }
    
    return ui;
});